package com.gpframework.module.system.service.impl;

import com.gpframework.module.system.domain.SysRoleDept;
import com.gpframework.module.system.domain.vo.SysRoleDeptVo;
import com.gpframework.module.system.mapper.SysRoleDeptMapper;
import com.gpframework.module.system.service.ISysRoleDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色部门关联业务层实现类
 *
 * @author zcl
 */
@Service
public class SysRoleDeptServiceImpl implements ISysRoleDeptService {

    @Autowired
    private SysRoleDeptMapper sysRoleDeptMapper;

    /**
     * 根据id查询vo
     *
     * @param roleId
     * @return
     */
    @Override
    public SysRoleDeptVo getVo(Long roleId) {
        return sysRoleDeptMapper.getVo(roleId);
    }

    /**
     * 根据id查询
     *
     * @param roleId
     * @return
     */
    @Override
    public SysRoleDept get(Long roleId) {
        return sysRoleDeptMapper.get(roleId);
    }

    /**
     * 批量新增角色部门信息
     *
     * @param roleDeptList 角色部门列表
     * @return 结果
     */
    @Override
    public int batchRoleDept(List<SysRoleDept> roleDeptList) {
        return sysRoleDeptMapper.batchRoleDept(roleDeptList);
    }

    /**
     * 批量删除角色部门关联信息
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRoleDept(Long[] ids) {
        return sysRoleDeptMapper.deleteRoleDept(ids);
    }
}
